﻿//var jq$ = jQuery.noConflict(); //防止$符号与其他的冲突
//jq$(document).ready(function () {   //防止在DOM元素加载完成就执行jQuery代码，从而避免产生不必要的错误
//    jq$("*").keydown(function (e) {//判断按键
//        e = window.event || e || e.which;
//        if (e.keyCode == 112 || e.keyCode == 113
//            || e.keyCode == 114) {
//            if (e.keyCode == 112) {
//                fnOperator(1);
//            }
//            if (e.keyCode == 113) {
//                fnOperator(2);
//            }
//            if (e.keyCode == 114) {
//                fnOperator(3);
//            }
//            e.keyCode = 0;
//            return false;
//        }
//    });
//    //document.onhelp = function () { return false };//
//    // window.onhelp = function () { return false };//ie下面不能屏蔽f1键的补充方法,和上面的一行的效果是一样的，选其一
//});


//var fnReloadData = function (key) {
//    var _condition = "1=1 ";

//    _condition += " and bus_no='" + key + "'";
    

//    // grid.setUrl("../data/jsondata.aspx?entity=v_fin_BillAuditing&condition=" + encodeURI(_condition) + "&datagrid=true");
//    grid.setUrl("../data/jsondata.aspx?totalfields=" + getPar("totalfields") + "&entity=v_t_mains&condition=" + encodeURI(_condition) + "&datagrid=true");

//    grid.load();
//};



//报关单操作人 1 整理人 2制单人 3复核人 add by zengtongchun 2015-10-19
function fnOperator(id) {
    var prefix = "";
    var prefixData = fnGetEntityInstance("v_data_base_dictionary_detail", "code='bg_kouanleixing' and value='" + transNo + "'");
    
    if (prefixData != null) {
        prefix = prefixData.description;
    }
    if (id == 1) {
        mini.open({
            url: "../CustomsClearance/BgPack",
            title: "整理报关单",
            width: 300,
            height: 350,
            ondestroy: function (action) {
                grid.reload();
            }
        });
        return;
    }
    if (id == 2) {
        mini.open({
            url: "../CustomsClearance/BgQuickQuery",
            title: "报关单查询",
            width: 400,
            height: 225,
            onload: function () {       //弹出页面加载完成
                var iframe = this.getIFrameEl();
                var data = { prefix: prefix };

                //调用弹出页面方法进行初始化
                iframe.contentWindow.SetData(data);
            },
            ondestroy: function (action) {
                //if (action=="ok") {
                //    var iframe = this.getIFrameEl();
                //    var data = iframe.contentWindow.GetData();
                    
                //}
               
            }
        });
        return;
    }
    if (id == 3) {
        mini.open({
            url: "../CustomsClearance/BgCheck",
            title: "复核",
            width: 400,
            height: 225,
            onload: function () {       //弹出页面加载完成
                var iframe = this.getIFrameEl();
                var data = { prefix: prefix };

                //调用弹出页面方法进行初始化
                iframe.contentWindow.SetData(data);

            },
            ondestroy: function (action) {

            }
        });
    }
    if (id == 4) {
        mini.open({
            url: "../CustomsClearance/BgLYQuickQuery",
            title: "快速调单",
            width: 400,
            height: 225,
            onload: function () {       //弹出页面加载完成
                var iframe = this.getIFrameEl();
                var data = { prefix: prefix};
               
                //调用弹出页面方法进行初始化
                iframe.contentWindow.SetData(data);

            },
            ondestroy: function (action) {

            }
        });
    }
}